<template>
  <div class="sticky-card">
    <div class="s-header">
      {{ time }}
      <div class="line"></div>
    </div>
    <div class="s-content">
      <div class="s-img">
        <div class="tag">{{ tag }}</div>
        <img :src="imgUrl" alt="图片展示" />
      </div>
      <div class="s-down">
        <div class="s-desc">
          <div class="s-title">{{ title }}</div>
          <div class="s-detail">
            {{ detail }}
          </div>
        </div>
        <div class="s-btn">预约</div>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  name: "StickyCard",
  props: {
    time: String,
    tag: String,
    imgUrl: String,
    title: String,
    detail: String,
  },
  data() {
    return {};
  },
};
</script>
<style lang="scss" scoped>
.sticky-card {
  background-color: white;
  padding: 0.24rem;
  .s-header {
    font-size: 0.32rem;
    font-weight: 700;
    position: sticky;
    top: 0;
    display: flex;
    .line {
      background: #ddd;
      align-self: center;
      height: 1px;
      margin-left: 0.4rem;
      flex: 1;
    }
  }
  .s-content {
    .s-img img {
      width: 5.76rem;
      height: 3.2416rem;
      margin-top: 0.48rem;
      position: relative;
    }
    .s-down {
      height: 1.444rem;
      display: flex;
      justify-content: space-between;
      align-items: center;
      .s-btn {
        background: #d8f6f8;
        color: $themeColor;
        padding: 0.16rem;
        border-radius: 20%;
      }

      .s-desc {
        display: flex;
        flex-direction: column;
        width: 4.28rem;
        .s-title {
          @include ellipsis();
          font-weight: 700;
          font-size: 0.32rem;
        }
        .s-detail {
          @include multellipsis(2);
          margin-top: 0.1rem;
          line-height: 1.5em;
          font-size: 0.24rem;
          color: $fontGrayColor;
        }
      }
    }

    .s-img {
      .tag {
        color: $themeColor;
        font-size: 0.24rem;
        z-index: 2;
        margin-top: 0.2rem;
        position: absolute;
        background: #d8f6f8;
        padding: 0.1rem;
      }
    }
  }
}
</style>